package com.leijie.thrift;

import com.leijie.thrift.DataException;
import com.leijie.thrift.Persion;
import com.leijie.thrift.PersionService;
import org.apache.thrift.TException;

/**
 * @author LeiJie
 * @time 2020-4-30 14:13
 * @desc TODO
 */
public class PersionServiceImpl implements PersionService.Iface {

    @Override
    public Persion getPersionByName(String name) throws DataException, TException {
        System.out.println("GET:"+name);
        Persion persion = new Persion();
        persion.setName(name);
        persion.setAge(1000);
        persion.setMarried(true);
        return persion;
    }

    @Override
    public void savePersion(Persion persion) throws DataException, TException {
        System.out.println("SAVE:"+persion.getName() +">>>"+ persion.getAge() +">>>"+ persion.isMarried());
    }
}
